package com.imooc.admin.controller;

import org.springframework.security.crypto.bcrypt.BCrypt;

public class PWDTest {

    public static void main(String[] args) {
        // 密码加密
        // 引入了 spring-cloud-starter-openfeign 依赖
        // 这里会有 Spring Security
        String pwd = BCrypt.hashpw("admin", BCrypt.gensalt());
        System.out.println("pwd = " + pwd);

        // 密码校验
        boolean isOK = BCrypt.checkpw("admin", pwd);
        System.out.println("isOK = " + isOK);
    }

}
